local skel = fk.CreateSkill {
  name = "emo__lianhuo",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["emo__lianhuo"] = "链祸",
  [":emo__lianhuo"] = "锁定技，当你受到火焰伤害时，须选一项：弃置1张手牌；此伤害+1。若你为伤害传导源，前文数字+1。",

  ["#emo__lianhuo-discard"] = "链祸：你须弃置 %arg 张手牌，否则受到火焰伤害+%arg",

  ["$emo__lianhuo1"] = "这这这，怎么可能！",
  ["$emo__lianhuo2"] = "定是你们这些将士不出力！",
}

skel:addEffect(fk.DamageInflicted, {
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and
      data.damageType == fk.FireDamage
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local n = 1
    if not data.chain and player.chained then
      n = 2
    end
    if player:getHandcardNum() >= n then
      local cards = room:askToDiscard(player, {
        min_num = n, max_num = n, include_equip = false, skill_name = skel.name, prompt = "#emo__lianhuo-discard:::"..n,
      })
      if #cards == n then
        return
      end
    end
    room:setEmotion(player, "./packages/maneuvering/image/anim/vineburn")
    data:changeDamage(n)
  end,
})

return skel
